Processing devices sometimes employ one or more caches to provide a temporary, rapid access storage location for a processor. In response to a store instruction being executed at the processor, a cache determines whether a cache line of the cache is already associated with the store address. In the case of a cache hit, the cache stores the data at the cache line associated with the store address. If there is no cache line associated with the store address containing valid data a cache miss occurs. In the event of a cache miss, the cache determines a cache line to store the store data by identifying the least recently used (LRU) cache line of the cache. Data stored at the LRU cache line is replaced with the data being stored and a tag of the cache line is associated with the store address. In order to preserve a cache line for critical data, a software program or routine at the processor can instruct the cache to lock a cache line, thereby forcing the cache line to be associated with a specific memory address to ensure that the locked cache line will not be replaced in the cache by data associated with another memory address.
In addition to storing data, a cache can store coherency status information for each cache line in order to maintain coherency of the data in the cache with external memory and other caches of the processing system. For example, a valid bit associated with a cache line can be invalidated in response to receiving an indication that the memory address associated with the cache line has been requested for access at a memory location external to the cache. In response to an external memory access to a memory address associated with a cache line, current processing devices will automatically place the cache line in an unlocked state, thereby allowing the cache line to be allocated to store data from any address. Accordingly, in order to maintain the locked state of a cache line that is invalidated, a software program or routine must monitor a locked cache line and relock the cache line when it is invalidated. This increases the size of the software program and reduces its efficiency. Accordingly, there is a need for a new processing device.